﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DotNet.Utilities;

namespace TopNewLib.TopNews
{
    public abstract class BaseTop
    {
        public string LinkURL;
        public abstract List<TopNewItem> GetCurTopNews();

        public string GetHtmlInfo()
        {
            string rs = "";

            if (string.IsNullOrWhiteSpace(LinkURL)==false)
            {
                HttpHelper http = new HttpHelper();
                HttpItem item = new HttpItem()
                {
                    URL = LinkURL,
                    Method = "get",
                    ContentType = "text/html",
                };
                HttpResult result = http.GetHtml(item);
                rs = result.Html;
            }

            return rs;
        }
    }
}
